import { createBrowserRouter, Navigate } from "react-router-dom";
import { AuthRoute, Layout, Login, Profile, ProfileEdit, Home } from "./components"

export default createBrowserRouter([
  {
    path: "/",
    element: <Layout />,
    children: [
      {
        index: true,
        element: <Navigate to="/home" />,
      },
      {
        path: "home",
        element: <Home />,
      },
      {
        path: "question",
        element: <>你好question</>,
      },
      {
        path: "video",
        element: <>你好video</>,
      },
      {
        path: "profile",
        element: <AuthRoute><Profile /></AuthRoute>,
      },
      {
        path: "profile/edit",
        element: <AuthRoute><ProfileEdit /></AuthRoute>,
      }
    ]
  },
  {
    path: "/login",
    element: <Login />,
  }
]);
